<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ajax</title>
<body>    
    <h1>使用jq jsonp</h1>
    <script src="./jquery-3.3.1.js"></script>
    <script>
        $(function(){
            $.ajax({
                url:"http://www.520mg.com/mi/list.php",
                success(res){
                    console.log(res);
                }
            })
        })
    </script>
   <!--  <script>
        $(function(){
            $.ajax({
                url:"https://wis.qq.com/weather/common?weather_type=observe|forecast_24h|air&source=pc&province=河南&city=郑州",
                // 使用jquery callback时候要url要删除 &callback=callback 因为他会自动创建
                dataType:"jsonp",
                // jsonpCallback:"callback",
                success(res){
                    alert ("当前的天气是:"+res.data.observe.weather);
                }
            })
        })
    </script> -->
   <!--  <h1>手动实现跨域</h1>
    <script>
        function callback(res){
            console.log(res);
            alert ("当前的天气是:"+res.data.observe.weather);
        }
    </script>
    <script src="https://wis.qq.com/weather/common?weather_type=observe|forecast_24h|air&source=pc&province=河南&city=郑州&callback=callback"></script>
  -->

    
</body>
</html>